package blog.service;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import blog.hibernate.BlogHibernate;
import blog.model.Blog;

@Service
public class BlogService {
	
	@Autowired private BlogHibernate blogHibernate;
	
	public void createBlog(Blog blog) {
		blogHibernate.createBlog(blog);		
	}
	
	public Collection<Blog> findBlogs() {
		return blogHibernate.findBlogs();		
	}
	
	public Blog findBlog(int blogId) {
		return blogHibernate.findBlog(blogId);
	}
	
	public void updateBlog(Blog blog) {
		blogHibernate.updateBlog(blog);
	}
	
	public void deleteBlog(int blogId) {
		blogHibernate.deleteBlog(blogId);
	}
}
